package com.example.venue_reservation_service.config;
import com.example.venue_reservation_service.interceptor.JWTInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new JWTInterceptor())
                .addPathPatterns("/user/**")
                .addPathPatterns("/reservation/**")
//                .addPathPatterns("/information/**")
//                .addPathPatterns("/hot/**")
//                .addPathPatterns("/type/**")
                .addPathPatterns("/slot/**")
                .addPathPatterns("/admin/**")
                .addPathPatterns("/school/**")
                .excludePathPatterns("/user/test")
                .excludePathPatterns("/user/admin")
                .excludePathPatterns("/user/reset")
                .excludePathPatterns("/chat/**")
                .excludePathPatterns("/reservation/excel")
                .excludePathPatterns("/reservation/payment")
                .excludePathPatterns("/swagger-ui/index.html")
                .excludePathPatterns("/doc.html")
                .excludePathPatterns("/user/login");
    }

}
